{{--默认文章详情页模板--}}
@extends('theme.jishupucms.layouts.app')

{{-- head投放区域 --}}
@section('head-css-cast')
    @parent
    <link rel="stylesheet" href="{{config('jishupucms.css')}}/image-preview-modal.min.css">
@endsection
@section('head-js-cast')
    @parent
@endsection

{{-- seo --}}
@section('title', $meta['title'])
@section('keywords', $meta['keywords'])
@section('description', $meta['description'])

{{--body class--}}
@section('body-class', 'jsp-bg')

{{-- 核心内容 --}}
@section('content')
    @parent

    {{-- banner --}}
    <section class="jsp-banner-section">
        <x-carousel id="carousel-{{$category->id}}" class="" :list="$ads"/>
    </section>

    {{-- 当前位置 --}}
    <x-breadcrumb :list="$breadcrumb" :class="empty($ads) || $ads->isEmpty() ?'jsp-navheight':''"/>

    {{-- 内容区域 --}}
    <section class="info-news-detail jsp-content-section container">

        <div class="left">
            <div class="content">
                <h1 class="title">{{$detail['title']}}</h1>
                <div class="source">
                    <span class="datetime">{{__('common.created_at')}}：{{$detail->created_at->format('Y-m-d')}}</span>
                    @if(isset($detail->infoNews->source) && $detail->infoNews->source)
                        <span class="from">{{__('common.source')}}：{{$detail->infoNews->source??''}}</span>
                    @endif
                </div>
                <div class="content-center">
                    {!! $detail->infoNews->content !!}
                </div>
                @if(isset($detail->infoNews->author) && $detail->infoNews->author)
                    <p class="author">
                        {{__('common.author')}}：{{$detail->infoNews->author??''}}
                    </p>
                @endif
            </div>
            <div class="prev-next-article">
                <ul>
                    @if($prev)
                        <li><a {{$prev['href_']}}  {{$prev['rel_']}} >{{__('info.prev')}}：{{$prev['title']}} </a></li>
                    @endif
                    @if($next)
                        <li><a {{$next['href_']}}  {{$next['rel_']}} >{{__('info.next')}}：{{$next['title']}} </a></li>
                    @endif
                </ul>
            </div>
        </div>
        <div class="right">
            {{--搜索区域--}}
            <form class="search  mb-3" action="{{$category->href}}">
                @csrf
                <div class="form-row align-items-center">
                    <div class="col-auto">
                        <label class="sr-only" for="inlineFormInput">{{__('common.keywords')}}</label>
                        <input type="text" class="form-control mb-2" id="inlineFormInput" name="keywords"
                               placeholder="{{__('common.please_enter_kw')}}">
                    </div>
                    <div class="col-auto">
                        <button type="submit" class="btn btn-primary mb-2">{{__('common.search')}}</button>
                    </div>
                </div>
            </form>
            {{--最新--}}
            <h3 class="mb-3 pb-3 block-title">{{__('info.new')}}</h3>
            <div class="relation-block mt-3 mb-3">
                <ul>
                    @if (isset($newList) && !empty($newList))
                        @foreach ($newList as $item)
                            <li><a {{$item['href_']}} {{$item['rel_']}}>
                                    @if(isset($item['image_url']) && !empty($item['image_url']))
                                        <img src="{{$item['image_url']}}" alt="{{$item['title']}}">
                                    @endif
                                    <span>{{strLimit($item['title'],70, '...')}}</span>
                                </a>
                            </li>
                        @endforeach
                    @endif
                </ul>
            </div>

        </div>
    </section>




@endsection

{{-- 底部投放区域 --}}
@section('footer-cast')
    @parent
@endsection

